using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Windows;

public class PlayerIdleState : PlayerState
{
    private int inputX;
    private int inputY;

    public PlayerIdleState(Player player, PlayerStateMachine stateMachine,string animBoolname) : base(player, stateMachine,animBoolname)
    {

    }

    public override void Enter()
    {
        base.Enter();
        core.SetVelocity(0f, new Vector2(player.Controller.NormInputX, player.Controller.NormInputY));
    }

    public override void Exit()
    {
        base.Exit();
    }

    public override void LogicUpdate()
    {
        base.LogicUpdate();
        inputX = player.Controller.NormInputX;
        inputY = player.Controller.NormInputY;

        if (player.Controller.AttackInput)
        {
            stateMachine.ChangeState(player.AttackState);
        }
        if ((inputX != 0 || inputY != 0) && !isExitingState)
        {
            stateMachine.ChangeState(player.MoveState);
        }
    }

    public override void PhysicsUpdate()
    {
        base.PhysicsUpdate();
    }
}
